package com.yllt4cloud.common.core.exception;

import com.yllt4cloud.common.core.util.ResultResp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @description:
 * @author: yaoxj
 * @create: 2020-01-19 18:48
 **/

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandlerResolver {

    @ExceptionHandler(MessageException.class)
    public ResultResp handleGlobalException(MessageException msgException) {
        ResultResp rep=new ResultResp(msgException.getErrorMsg(),msgException.getErrorCode());
        return rep;
    }
}
